package com.github.postsanf.yinian.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;

import com.github.postsanf.yinian.R;
import com.umeng.analytics.MobclickAgent;

public class ShowLocationDialog extends Activity {
    private TextView dialog_title;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_show_location_dialog);
        dialog_title = (TextView) findViewById(R.id.dialog_title);
        dialog_title.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        String text = getIntent().getStringExtra("text");
        if (text.length() < 12) {
            dialog_title.setGravity(Gravity.CENTER);
        } else {
            dialog_title.setGravity(Gravity.CENTER_VERTICAL);
        }
        dialog_title.setText(text);
        findViewById(R.id.show_location).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

    // 友盟统计
    public void onResume() {
        super.onResume();
        MobclickAgent.onPageStart(this.getClass().getSimpleName());
        MobclickAgent.onResume(this);
    }

    public void onPause() {
        super.onPause();
        MobclickAgent.onPageEnd(this.getClass().getSimpleName());
        MobclickAgent.onPause(this);
    }
}
